using UnityEngine;

public class CameraManager : MonoBehaviour
{
	public PlayerManager Player;

	public bool FollowPlayerX;

	public bool FollowPlayerY;

	public float CameraSpeed;

	private bool previousvfx;

	public AudioReverbFilter ReverbFilter;

	public static CameraManager instance;

	private void Awake()
	{
		instance = this;
	}

	private void Start()
	{
		AudioListener.volume = 0.4f;
	}

	private void Update()
	{
		if (!BattleSystem.CurrentlyInBattle)
		{
			MoveCamera();
		}
		if ((Object)(object)Player == (Object)null)
		{
			Player = PlayerManager.Instance;
		}
		if (previousvfx != SettingsManager.Instance.GetBoolSettingValue("SimpleSFX"))
		{
			previousvfx = SettingsManager.Instance.GetBoolSettingValue("SimpleSFX");
			((Behaviour)ReverbFilter).enabled = !SettingsManager.Instance.GetBoolSettingValue("SimpleSFX");
		}
	}

	private void MoveCamera()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		if (FollowPlayerX)
		{
			((Component)this).transform.position = new Vector3(((Component)PlayerManager.Instance).transform.position.x, ((Component)this).transform.position.y, -10f);
		}
		if (FollowPlayerY)
		{
			((Component)this).transform.position = new Vector3(((Component)this).transform.position.x, ((Component)((Component)PlayerManager.Instance).transform).transform.position.y - 0.001f, -10f);
		}
	}
}
